#include <iostream>

using namespace std;

class Draw{
private:
    int height;
public:
    Draw(int h){
        if(h>3)height=h;
    }
    void drawtriangle(){
        if (height <= 0) return;
    for(int i=1;i<=height;i++)
    {
        for(int m=height-i;m>0;m--){
            cout<<" ";
        }
        for(int n=0;n<2*i-1;n++){
            cout<<"*";
        }
        cout << endl;
    }
    }
    void drawrectangle(){
        if (height <= 0) return;
        for(int i=1;i<=height;i++){
            for(int p=1;p<=height+2;p++){
                cout<<"*";
            }
        cout << endl;
        }
    }
    void drawsquare(){
        if (height <= 0) return;
        for(int i=1;i<=height;i++){
            for(int q=1;q<=height;q++){
                cout<<"*";
            }
        cout << endl;
        }
    }
    void drawparallelogram(){
        if (height <= 0) return;
        for(int i=1;i<=height;i++){
            for(int x=0;x<height-i;x++){
                cout<<" ";
            }
            for(int y=1;y<height;y++){
                cout<<"*";
            }
            cout << endl;
        }
    }
};
int main()
{
    Draw draw(5);
    draw.drawtriangle();
    cout << endl;
    draw.drawrectangle();
    cout << endl;
    draw.drawsquare();
    cout << endl;
    draw.drawparallelogram();
    return 0;
}
